package br.edu.ufcg.msnlab2.grupo07.monteCarlo;

/**
 * This class represents a tuple of two elements a and k.
 * @author David Candeia
 * @author Felipe Leal
 * @param <K> The type of the first parameter
 * @param <A> The type of the second parameter
 */
public class Tuple<K,A> {

	private K k; 
	private A a;
	
	/**
	 * Constructor
	 * @param k The first element of the tuple
	 * @param a The second element of the tuple
	 */
	public Tuple(K k, A a){
		this.k = k;
		this.a = a;
	}

	/**
	 * This method is responsible for obtaining the first element
	 * of the tuple
	 * @return The first element of the tuple
	 */
	public K getK() {
		return k;
	}
	
	/**
	 * This method is responsible for changing the first element
	 * of the tuple
	 */
	public void setK(K k) {
		this.k = k;
	}
	
	/**
	 * This method is responsible for obtaining the second element
	 * of the tuple
	 * @return The second element of the tuple
	 */
	public A getA() {
		return a;
	}
	
	/**
	 * This method is responsible for changing the second element
	 * of the tuple
	 */
	public void setA(A a) {
		this.a = a;
	}
	
	/**
	 * This method returns a string representation of the tuple in 
	 * the format (\d+, \d+)
	 */
	public String toString(){
		return "("+k.toString()+","+a.toString()+")";
	}
}
